
/**
 * @author Team 29
 * This class documents a patient's doctors orders within the database.
 *
 */
public class DoctorsOrders {
	private String prescription;
	private String labWork;
	private String followUpInstructions;
	private String otherInstructions;
	public DoctorsOrders(String prescription, String labWork, 
			String followUpInstructions, String otherInstructions){
		this.prescription=prescription;
		this.labWork=labWork;
		this.followUpInstructions=followUpInstructions;
		this.otherInstructions=otherInstructions;
	}
	/**
	 * @return prescription
	 */
	public String getPrescription() {
		return prescription;
	}
	/**
	 * @param prescription
	 */
	public void setPrescription(String prescription) {
		this.prescription = prescription;
	}
	/**
	 * @return labWork
	 */
	public String getLabWork() {
		return labWork;
	}
	/**
	 * @param labWork
	 */
	public void setLabWork(String labWork) {
		this.labWork = labWork;
	}
	/**
	 * @return followUpInstructions
	 */
	public String getFollowUpInstructions() {
		return followUpInstructions;
	}
	/**
	 * @param followUpInstructions
	 */
	public void setFollowUpInstructions(String followUpInstructions) {
		this.followUpInstructions = followUpInstructions;
	}
	/**
	 * @return otherInstructions
	 */
	public String getOtherInstructions() {
		return otherInstructions;
	}
	/**
	 * @param otherInstructions
	 */
	public void setOtherInstructions(String otherInstructions) {
		this.otherInstructions = otherInstructions;
	}
	public String toString(){
		String s= "";
		s+=prescription + "\t" +
			labWork + "\t" +
			followUpInstructions + "\t" +
			otherInstructions;
		return s;
	}
	public static DoctorsOrders fromString(String s){
		DoctorsOrders docOrd = null;
		try{
			String[] args = s.split("\t");
			docOrd= new DoctorsOrders(args[0],args[1],args[2],args[3]);
		}
		catch(Exception e){
			System.out.println("Error parsing Doctor's orders: " + s);
			Logger.log("Error parsing Doctor's orders: " + s);
		}
		return docOrd;
	}
}
